"""Setup script for MCP Memory System"""

from setuptools import setup, find_packages
from pathlib import Path

# Read the contents of README file
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text(encoding='utf-8')

# Read requirements
requirements = []
with open('requirements.txt', 'r', encoding='utf-8') as f:
    for line in f:
        line = line.strip()
        if line and not line.startswith('#'):
            # Remove version constraints for setup.py
            package = line.split('>=')[0].split('==')[0].split(';')[0]
            requirements.append(package)

setup(
    name="mcp-memory-system",
    version="1.0.0",
    author="MCP Memory System Team",
    author_email="contact@example.com",
    description="集成式多层记忆架构AI系统 - 基于MCP协议的智能记忆管理系统",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://github.com/example/mcp-memory-system",
    packages=find_packages(where="src"),
    package_dir={"": "src"},
    classifiers=[
        "Development Status :: 4 - Beta",
        "Intended Audience :: Developers",
        "Intended Audience :: Science/Research",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Programming Language :: Python :: 3.12",
        "Topic :: Scientific/Engineering :: Artificial Intelligence",
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Topic :: Database",
        "Topic :: Internet :: WWW/HTTP :: HTTP Servers",
    ],
    python_requires=">=3.9",
    install_requires=requirements,
    extras_require={
        "dev": [
            "pytest>=7.4.0",
            "pytest-asyncio>=0.21.0",
            "pytest-cov>=4.1.0",
            "black>=23.11.0",
            "flake8>=6.1.0",
            "mypy>=1.7.0",
            "isort>=5.12.0",
            "pre-commit>=3.5.0",
        ],
        "docs": [
            "sphinx>=7.1.0",
            "sphinx-rtd-theme>=1.3.0",
            "myst-parser>=2.0.0",
        ],
        "monitoring": [
            "prometheus-client>=0.19.0",
            "grafana-api>=1.0.3",
        ],
        "performance": [
            "uvloop>=0.19.0; sys_platform != 'win32'",
            "orjson>=3.9.0",
            "cython>=3.0.0",
        ],
    },
    entry_points={
        "console_scripts": [
            "mcp-memory=main:main",
            "mcp-memory-server=main:main",
        ],
    },
    include_package_data=True,
    package_data={
        "config": ["*.yaml", "*.yml", "*.json"],
        "": ["*.md", "*.txt", "*.cfg"],
    },
    zip_safe=False,
    keywords=[
        "mcp",
        "memory",
        "ai",
        "artificial intelligence",
        "knowledge management",
        "vector database",
        "semantic search",
        "conversation",
        "context",
        "redis",
        "mongodb",
        "neo4j",
        "chromadb",
        "fastapi",
        "asyncio",
    ],
    project_urls={
        "Bug Reports": "https://github.com/example/mcp-memory-system/issues",
        "Source": "https://github.com/example/mcp-memory-system",
        "Documentation": "https://mcp-memory-system.readthedocs.io/",
    },
)